using System;
using UnityEngine;

public class iCloudManager : ISN_Singleton<iCloudManager>
{
	public const string CLOUD_INITIALIZED = "cloud_initialized";

	public const string CLOUD_INITIALIZE_FAILED = "cloud_initialize_failed";

	public const string CLOUD_DATA_CHANGED = "cloud_data_changed";

	public const string CLOUD_DATA_RECEIVE = "cloud_data_receive";

	public Action<ISN_Result> OnCloundInitAction = delegate
	{
	};

	public Action OnCloundDataChangedAction = delegate
	{
	};

	public Action<iCloudData> OnCloudDataReceivedAction = delegate
	{
	};

	private void Awake()
	{
		UnityEngine.Object.DontDestroyOnLoad(base.gameObject);
	}

	public void init()
	{
	}

	public void setString(string key, string val)
	{
	}

	public void setFloat(string key, float val)
	{
	}

	public void setData(string key, byte[] val)
	{
	}

	public void requestDataForKey(string key)
	{
	}

	private void OnCloudInit()
	{
		ISN_Result obj = new ISN_Result(true);
		OnCloundInitAction(obj);
		dispatch("cloud_initialized");
	}

	private void OnCloudInitFail()
	{
		ISN_Result obj = new ISN_Result(false);
		OnCloundInitAction(obj);
		dispatch("cloud_initialize_failed");
	}

	private void OnCloudDataChanged()
	{
		OnCloundDataChangedAction();
		dispatch("cloud_data_changed");
	}

	private void OnCloudData(string array)
	{
		string[] array2 = array.Split("|"[0]);
		iCloudData iCloudData2 = new iCloudData(array2[0], array2[1]);
		OnCloudDataReceivedAction(iCloudData2);
		dispatch("cloud_data_receive", iCloudData2);
	}

	private void OnCloudDataEmpty(string array)
	{
		string[] array2 = array.Split("|"[0]);
		iCloudData iCloudData2 = new iCloudData(array2[0], "null");
		OnCloudDataReceivedAction(iCloudData2);
		dispatch("cloud_data_receive", iCloudData2);
	}
}
